<template>
    <div>
        <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
            prop="id"
            label="职责编号"
            width="180">
        </el-table-column>
        <el-table-column
            prop="name"
            label="职责名称"
            width="180">
        </el-table-column>
        </el-table>         
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            tableData:[], // 接受职责信息

        }
    },
    methods:{
        getDuty(){
            axios.get("dutys/")
            .then((res) => {
                console.log("预览职责信息", res)
                this.tableData = res.data
            }).catch((err) => {
                console.log(err)
            });
        }
    },
    mounted(){
        this.getDuty();
    }
}
</script>

<style>

</style>